package client.control;

import base.BaseValue;

import java.util.HashMap;
import java.util.Map;

/**
  * @Description 点评网络接口封装
  * @author 孔明浩
  * @Date 2020/4/8
  */
public class EvaluationControl {
    EvaluationControl(){}
    public ResponseEntity addEvaluation(String token, int goodId, int star){
        ConnectControl connectControl = new ConnectControl();
        Map<String ,String> map = new HashMap<>();
        map.put("goodId", goodId + "");
        map.put("star", star + "");
        connectControl.doPost(BaseValue.load + "addEvaluation", token, map);
        return ResponseEntity.fit(connectControl);
    }

    public ResponseEntity getStarAverage(int goodId){
        ConnectControl connectControl = new ConnectControl();
        Map<String, String> map = new HashMap<>();
        map.put("goodId", goodId + "");
        connectControl.doPost(BaseValue.load + "getStarAverage", null, map);
        return ResponseEntity.fit(connectControl);
    }
}
